import request from '@/utils'

const base_api = '/admin/system/sysUser'

export const getRemoteList = async (params) => {
  return request({
    url: `${base_api}/findByPage`,
    method: 'post',
    data: params,
  })
}

export const editRecord = async (values) => {
  return request({
    url: `${base_api}/updateSysUser`,
    method: 'post',
    data: values,
  })
}

export const addRecord = async (values) => {
  return request({
    url: `${base_api}/saveSysUser`,
    method: 'post',
    data: values,
  })
}

export const deleteRecord = async (userId) => {
  return request({
      url: `${base_api}/deleteById`,
    method: 'post',
    data: {userId},
  })
}

export const queryList = async ({queryUsername, pageNum, pageSize}) => {
  return request({
    url: `${base_api}/queryByUsername`,
    method: 'post',
    data: {
      queryUsername,
      pageNum,
      pageSize,
    },
  })
}

export const getUserInfoById = async (id) => {
  return request({
    url: `${base_api}/getUserInfoById`,
    method: 'post',
    data: {
      id,
    },
  })
}
